@hyperlex/mammoth 1.4.9-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.eslintrc.json +77 -0
  2. package/.github/ISSUE_TEMPLATE.md +12 -0
  3. package/.idea/mammoth.js.iml +12 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.travis.yml +10 -0
  7. package/LICENSE +22 -0
  8. package/NEWS +373 -0
  9. package/README.md +883 -0
  10. package/bin/mammoth +38 -0
  11. package/browser/docx/files.js +14 -0
  12. package/browser/unzip.js +12 -0
  13. package/lib/document-to-html.js +453 -0
  14. package/lib/documents.js +238 -0
  15. package/lib/docx/body-reader.js +636 -0
  16. package/lib/docx/comments-reader.js +31 -0
  17. package/lib/docx/content-types-reader.js +58 -0
  18. package/lib/docx/document-xml-reader.js +26 -0
  19. package/lib/docx/docx-reader.js +222 -0
  20. package/lib/docx/files.js +67 -0
  21. package/lib/docx/notes-reader.js +28 -0
  22. package/lib/docx/numbering-xml.js +69 -0
  23. package/lib/docx/office-xml-reader.js +58 -0
  24. package/lib/docx/relationships-reader.js +43 -0
  25. package/lib/docx/style-map.js +75 -0
  26. package/lib/docx/styles-reader.js +70 -0
  27. package/lib/docx/uris.js +21 -0
  28. package/lib/html/ast.js +50 -0
  29. package/lib/html/index.js +41 -0
  30. package/lib/html/simplify.js +88 -0
  31. package/lib/images.js +29 -0
  32. package/lib/index.js +115 -0
  33. package/lib/main.js +63 -0
  34. package/lib/options-reader.js +98 -0
  35. package/lib/promises.js +42 -0
  36. package/lib/results.js +72 -0
  37. package/lib/style-reader.js +321 -0
  38. package/lib/styles/document-matchers.js +74 -0
  39. package/lib/styles/html-paths.js +81 -0
  40. package/lib/styles/parser/tokeniser.js +30 -0
  41. package/lib/transforms.js +61 -0
  42. package/lib/underline.js +11 -0
  43. package/lib/unzip.js +22 -0
  44. package/lib/writers/html-writer.js +160 -0
  45. package/lib/writers/index.js +14 -0
  46. package/lib/writers/markdown-writer.js +163 -0
  47. package/lib/xml/index.js +7 -0
  48. package/lib/xml/nodes.js +69 -0
  49. package/lib/xml/reader.js +83 -0
  50. package/lib/xml/writer.js +61 -0
  51. package/lib/zipfile.js +77 -0
  52. package/mammoth.browser.js +32950 -0
  53. package/mammoth.browser.min.js +18 -0
  54. package/package.json +65 -0
  55. package/test/.eslintrc.json +7 -0
  56. package/test/document-to-html.tests.js +834 -0
  57. package/test/docx/body-reader.tests.js +1342 -0
  58. package/test/docx/comments-reader.tests.js +52 -0
  59. package/test/docx/content-types-reader.tests.js +45 -0
  60. package/test/docx/document-matchers.js +37 -0
  61. package/test/docx/docx-reader.tests.js +179 -0
  62. package/test/docx/files.tests.js +94 -0
  63. package/test/docx/notes-reader.tests.js +35 -0
  64. package/test/docx/numbering-xml.tests.js +65 -0
  65. package/test/docx/office-xml-reader.tests.js +24 -0
  66. package/test/docx/relationships-reader.tests.js +65 -0
  67. package/test/docx/style-map.tests.js +112 -0
  68. package/test/docx/styles-reader.tests.js +133 -0
  69. package/test/docx/uris.tests.js +22 -0
  70. package/test/html/simplify.tests.js +134 -0
  71. package/test/html/write.tests.js +42 -0
  72. package/test/images.tests.js +34 -0
  73. package/test/main.tests.js +89 -0
  74. package/test/mammoth.tests.js +429 -0
  75. package/test/mocha.opts +1 -0
  76. package/test/options-reader.tests.js +63 -0
  77. package/test/results.tests.js +15 -0
  78. package/test/style-reader.tests.js +256 -0
  79. package/test/styles/document-matchers.tests.js +71 -0
  80. package/test/styles/html-paths.tests.js +20 -0
  81. package/test/styles/parser/tokeniser.tests.js +104 -0
  82. package/test/test-data/comments.docx +0 -0
  83. package/test/test-data/embedded-style-map.docx +0 -0
  84. package/test/test-data/empty.docx +0 -0
  85. package/test/test-data/empty.zip +0 -0
  86. package/test/test-data/endnotes.docx +0 -0
  87. package/test/test-data/external-picture.docx +0 -0
  88. package/test/test-data/footnote-hyperlink.docx +0 -0
  89. package/test/test-data/footnotes.docx +0 -0
  90. package/test/test-data/hello.zip +0 -0
  91. package/test/test-data/hyperlinks/word/_rels/document.xml.rels +10 -0
  92. package/test/test-data/hyperlinks/word/document.xml +18 -0
  93. package/test/test-data/simple/word/document.xml +18 -0
  94. package/test/test-data/simple-list.docx +0 -0
  95. package/test/test-data/single-paragraph.docx +0 -0
  96. package/test/test-data/strikethrough.docx +0 -0
  97. package/test/test-data/tables.docx +0 -0
  98. package/test/test-data/text-box.docx +0 -0
  99. package/test/test-data/tiny-picture-target-base-relative.docx +0 -0
  100. package/test/test-data/tiny-picture.docx +0 -0
  101. package/test/test-data/tiny-picture.png +0 -0
  102. package/test/test-data/underline.docx +0 -0
  103. package/test/test-data/utf8-bom.docx +0 -0
  104. package/test/test.js +11 -0
  105. package/test/testing.js +55 -0
  106. package/test/transforms.tests.js +125 -0
  107. package/test/unzip.tests.js +38 -0
  108. package/test/writers/html-writer.tests.js +133 -0
  109. package/test/writers/markdown-writer.tests.js +304 -0
  110. package/test/xml/reader.tests.js +85 -0
  111. package/test/xml/writer.tests.js +81 -0
  112. package/test/zipfile.tests.js +59 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "extends": "eslint:recommended",
3
+
4
+ "rules": {
5
+ "curly": ["error", "all"],
6
+ "dot-location": ["error", "property"],
7
+ "no-alert": ["error"],
8
+ "no-caller": ["error"],
9
+ "no-eval": ["error"],
10
+ "no-extend-native": ["error"],
11
+ "no-extra-bind": ["error"],
12
+ "no-extra-label": ["error"],
13
+ "no-floating-decimal": ["error"],
14
+ "no-implicit-coercion": ["error", {"allow": ["!!"]}],
15
+ "no-implied-eval": ["error"],
16
+ "no-invalid-this": ["error"],
17
+ "no-labels": ["error"],
18
+ "no-lone-blocks": ["error"],
19
+ "no-native-reassign": ["error"],
20
+ "no-new": ["error"],
21
+ "no-new-func": ["error"],
22
+ "no-new-wrappers": ["error"],
23
+ "no-return-assign": ["error"],
24
+ "no-self-compare": ["error"],
25
+ "no-sequences": ["error"],
26
+ "no-throw-literal": ["error"],
27
+ "no-unused-expressions": ["error"],
28
+ "no-useless-call": ["error"],
29
+ "no-with": ["error"],
30
+ "no-unused-vars": ["error", {"args": "none"}],
31
+ "radix": ["error", "always"],
32
+
33
+ "array-bracket-spacing": ["error", "never"],
34
+ "brace-style": ["error", "1tbs"],
35
+ "camelcase": ["error"],
36
+ "comma-spacing": ["error", {"before": false, "after": true}],
37
+ "comma-style": ["error", "last"],
38
+ "computed-property-spacing": ["error", "never"],
39
+ "eol-last": ["error"],
40
+ "indent": ["error", 4],
41
+ "key-spacing": [
42
+ "error",
43
+ {"beforeColon": false, "afterColon": true, "mode": "strict"}
44
+ ],
45
+ "keyword-spacing": ["error", {"before": true, "after": true}],
46
+ "new-parens": ["error"],
47
+ "no-array-constructor": ["error"],
48
+ "no-continue": ["error"],
49
+ "no-lonely-if": ["error"],
50
+ "no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 1}],
51
+ "no-new-object": ["error"],
52
+ "no-spaced-func": ["error"],
53
+ "no-trailing-spaces": ["error", {"skipBlankLines": true}],
54
+ "no-whitespace-before-property": ["error"],
55
+ "object-curly-spacing": ["error", "never"],
56
+ "one-var": ["error", "never"],
57
+ "semi": ["error", "always"],
58
+ "semi-spacing": ["error", {"before": false}],
59
+ "space-before-function-paren": ["error", "never"],
60
+ "space-in-parens": ["error", "never"],
61
+ "space-infix-ops": ["error"],
62
+ "space-unary-ops": ["error", {"words": true, "nonwords": false}],
63
+ "spaced-comment": ["error", "always"],
64
+
65
+ "no-useless-escape": ["off"],
66
+ "no-prototype-builtins": ["off"]
67
+ },
68
+
69
+ "globals": {
70
+ "Buffer": false,
71
+ "console": true,
72
+ "exports": true,
73
+ "module": true,
74
+ "require": false,
75
+ "Uint8Array": false
76
+ }
77
+ }
@@ -0,0 +1,12 @@
1
+ If you're reporting a bug or requesting a feature, it's handy to have:
2
+ * a minimal example document
3
+ * the HTML output that you'd expect
4
+
5
+ If you're reporting a bug, it's also useful to know what platform you're
6
+ running on, including:
7
+
8
+ * the operating system and version
9
+ * if running in the browser:
10
+ * the browser and version
11
+ * whether you get the same issue in other browsers
12
+ * if running on node.js, the version you're using
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/mammoth.js.iml" filepath="$PROJECT_DIR$/.idea/mammoth.js.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ sudo: false
2
+ language: node_js
3
+ node_js:
4
+ - "12"
5
+ - "10"
6
+ - "8"
7
+ - "6"
8
+ - "4"
9
+ - "0.12"
10
+ - "0.10"
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013, Michael Williamson
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation
11
+ and/or other materials provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/NEWS ADDED
@@ -0,0 +1,373 @@
1
+ # 1.4.9
2
+
3
+ * Allow hyperlinks to be collapsed.
4
+
5
+ # 1.4.8
6
+
7
+ * Improve list support by following w:numStyleLink in w:abstractNum.
8
+
9
+ # 1.4.7
10
+
11
+ * Update xmlbuilder dependency.
12
+
13
+ # 1.4.6
14
+
15
+ * Fix: default style mappings caused footnotes, endnotes and comments
16
+ containing multiple paragraphs to be converted into a single paragraph.
17
+
18
+ # 1.4.5
19
+
20
+ * When using the pretty HTML writer, don't format HTML inside pre elements.
21
+
22
+ * Read the children of v:rect elements.
23
+
24
+ # 1.4.4
25
+
26
+ * Parse paragraph indents.
27
+
28
+ * Read part paths using relationships. This improves support for documents
29
+ created by Word Online.
30
+
31
+ # 1.4.3
32
+
33
+ * Add style mapping for small caps.
34
+
35
+ * Add style mapping for tables.
36
+
37
+ # 1.4.2
38
+
39
+ * Read children of v:group elements.
40
+
41
+ # 1.4.1
42
+
43
+ * Read w:noBreakHyphen elements as non-breaking hyphen characters.
44
+
45
+ # 1.4.0
46
+
47
+ * Extract the default data URI image converter to the images module.
48
+
49
+ * Add anchor on hyperlinks as fragment if present.
50
+
51
+ * Convert target frames on hyperlinks to targets on anchors.
52
+
53
+ * Detect header rows in tables and convert to thead > tr > th.
54
+
55
+ # 1.3.6
56
+
57
+ * Handle complex fields that do not have a "separate" fldChar.
58
+
59
+ # 1.3.5
60
+
61
+ * Add transforms.run.
62
+
63
+ # 1.3.4
64
+
65
+ * Read children of w:object elements.
66
+
67
+ # 1.3.3
68
+
69
+ * Handle hyperlinks created with complex fields.
70
+
71
+ # 1.3.2
72
+
73
+ * Handle absolute paths within zip files. This should fix an issue where some
74
+ images within a document couldn't be found.
75
+
76
+ # 1.3.1
77
+
78
+ * Add getDescendants() and getDescendantsOfType() to transforms module.
79
+
80
+ * Add font property to runs.
81
+
82
+ # 1.3.0
83
+
84
+ * Allow style names to be mapped by prefix. For instance:
85
+
86
+ r[style-name^='Code '] => code
87
+
88
+ * Add default style mappings for Heading 5 and Heading 6.
89
+
90
+ * Allow escape sequences in style IDs, style names and CSS class names.
91
+
92
+ * Allow a separator to be specified when HTML elements are collapsed.
93
+
94
+ * Add includeEmbeddedStyleMap option to allow embedded style maps to be
95
+ disabled.
96
+
97
+ * Include embedded styles when explicit style map is passed.
98
+
99
+ # 1.2.5
100
+
101
+ * Ignore bold, italic, underline and strikethrough elements that have a value of
102
+ false or 0.
103
+
104
+ # 1.2.4
105
+
106
+ * Ignore v:imagedata elements without relationship ID with warning.
107
+
108
+ # 1.2.3
109
+
110
+ * Expect end token when parsing style mappings. This causes warnings to be
111
+ emitted instead of silenting ignoring unparsed tokens.
112
+
113
+ # 1.2.2
114
+
115
+ * Ignore blank lines in style map.
116
+
117
+ # 1.2.1
118
+
119
+ * Use alt text title as alt text for images when the alt text description is
120
+ missing entirely.
121
+
122
+ # 1.2.0
123
+
124
+ * Throw more informative error when word/document.xml cannot be found.
125
+
126
+ * Generate messages of type "error" instead of "warning" when image conversion
127
+ throws an exception.
128
+
129
+ * Use alt text title as alt text for images when the alt text description is
130
+ blank.
131
+
132
+ # 1.1.0
133
+
134
+ * Add support for comments.
135
+
136
+ # 1.0.4
137
+
138
+ * Add support for w:sdt elements. This allows the bodies of content controls,
139
+ such as bibliographies, to be converted.
140
+
141
+ * Avoid stack overflows when elements have many children.
142
+
143
+ # 1.0.3
144
+
145
+ * Actually add support for table cells spanning multiple rows.
146
+
147
+ # 1.0.2
148
+
149
+ * Add support for table cells spanning multiple rows.
150
+
151
+ # 1.0.1
152
+
153
+ * Add support for table cells spanning multiple columns.
154
+
155
+ # 1.0.0
156
+
157
+ * Remove deprecated convertUnderline option.
158
+
159
+ * Officially support ID prefixes.
160
+
161
+ * Generated IDs no longer insert a hyphen after the ID prefix.
162
+
163
+ * The default ID prefix is now the empty string rather than a random number
164
+ followed by a hyphen.
165
+
166
+ * Rename mammoth.images.inline to mammoth.images.imgElement to better reflect
167
+ its behaviour.
168
+
169
+ # 0.3.33
170
+
171
+ * Improve collapsing of elements when there are empty elements.
172
+
173
+ # 0.3.32
174
+
175
+ * Allow bold and italic style mappings to be configured.
176
+
177
+ # 0.3.31
178
+
179
+ * Handle references to missing styles when reading documents.
180
+
181
+ # 0.3.30
182
+
183
+ * Improve support for lists made in LibreOffice. Specifically, this changes the
184
+ default style mapping for paragraphs with a style of "Normal" to have the
185
+ lowest precedence.
186
+
187
+ * Replace nomnom with argparse for CLI argument parsing. Usage should be the
188
+ same, but unknown arguments will now cause an exit with failure rather than
189
+ being ignored.
190
+
191
+ # 0.3.29
192
+
193
+ * Always use mc:Fallback when reading mc:AlternateContent elements.
194
+
195
+ # 0.3.28
196
+
197
+ * Avoid inserting newlines around inline elements when pretty-printing HTML.
198
+
199
+ * CLI: print warnings to stderr.
200
+
201
+ * Read v:imagedata with r:id attribute.
202
+
203
+ * Read children of v:roundrect.
204
+
205
+ * Ignore office-word:wrap, v:shadow and v:shapetype.
206
+
207
+ # 0.3.27
208
+
209
+ * Fix recursive collapsing of elements.
210
+
211
+ # 0.3.26
212
+
213
+ * Keep HTML elements open correctly when the HTML path contains no fresh
214
+ element.
215
+
216
+ * Collapse similar non-fresh HTML elements together.
217
+
218
+ * Don't escape double quotes outside of attributes.
219
+
220
+ # 0.3.25
221
+
222
+ * When the styleMap option is passed as a string, ignore lines beginning with #.
223
+
224
+ * Generate warnings for not-understood style mappings and continue, rather than
225
+ stopping with an error.
226
+
227
+ * Add support for embedded style maps.
228
+
229
+ * Add support for linked images.
230
+
231
+ # 0.3.24
232
+
233
+ * Ignore w:numPr elements without w:numId or w:ilvl children.
234
+
235
+ # 0.3.23
236
+
237
+ * Support links and images in footnotes and endnotes.
238
+
239
+ # 0.3.22
240
+
241
+ * Add support for underlines in style map.
242
+
243
+ * Add support for strikethrough.
244
+
245
+ # 0.3.21
246
+
247
+ * Add basic support for text boxes. The contents of the text box are treated as
248
+ a separate paragraph that appears after the paragraph containing the text box.
249
+
250
+ # 0.3.20
251
+
252
+ * Support styles defined without a name
253
+
254
+ # 0.3.19
255
+
256
+ * Add ignoreEmptyParagraphs option, which defaults to true.
257
+
258
+ # 0.3.18
259
+
260
+ * Make style names case-insensitive in style mappings. This should make style
261
+ mappings easier to write, especially since Microsoft Word sometimes represents
262
+ style names in the UI differently from in the style definition. For instance,
263
+ the style displayed in Word as "Heading 1" has a style name of "heading 1".
264
+ This hopefully shouldn't cause an issue for anyone, but if you were relying
265
+ on case-sensitivity, please do get in touch.
266
+
267
+ # 0.3.17
268
+
269
+ * Add support for hyperlinks to bookmarks in the same document.
270
+
271
+ # 0.3.16
272
+
273
+ * Add basic support for Markdown. Not all features are currently supported.
274
+
275
+ # 0.3.15
276
+
277
+ * Add default style mappings for builtin footnote and endnote styles in
278
+ Microsoft Word and LibreOffice.
279
+
280
+ * Allow style mappings with a zero-element HTML path.
281
+
282
+ * Emit warnings when image types are unlikely to be supported by web browsers.
283
+
284
+ * Update jszip to 2.4.0.
285
+
286
+ # 0.3.14
287
+
288
+ * Add support for endnotes.
289
+
290
+ # 0.3.13
291
+
292
+ * Update license-sniffer to fix license comments in mammoth.browser.js.
293
+
294
+ # 0.3.12
295
+
296
+ * Update bluebird dependency to fix operation in web workers.
297
+
298
+ # 0.3.11
299
+
300
+ * Add support for superscript and subscript text.
301
+
302
+ # 0.3.10
303
+
304
+ * Handle XML files that start with the UTF-8 BOM.
305
+
306
+ # 0.3.9
307
+
308
+ * Add support for reading Buffer instances.
309
+
310
+ # 0.3.8
311
+
312
+ * Add support for line breaks.
313
+
314
+ # 0.3.7
315
+
316
+ * Add optional underline conversion.
317
+
318
+ # 0.3.6
319
+
320
+ * Add helper `mammoth.transforms.paragraph`.
321
+
322
+ # 0.3.5
323
+
324
+ * Add `mammoth.images.inline`, and document custom image conversion.
325
+
326
+ # 0.3.4
327
+
328
+ * Add the function `mammoth.extractRawText`.
329
+
330
+ # 0.3.3
331
+
332
+ * Add support for tables.
333
+
334
+ # 0.3.2
335
+
336
+ * Add support for footnotes.
337
+
338
+ # 0.3.1
339
+
340
+ * Fix: all non-paragraph styles are treated as character styles when reading
341
+ styles from a docx document.
342
+
343
+ # 0.3.0
344
+
345
+ * Rename the existing concept of a "style name" to "style ID" to correspond to
346
+ the terminology used internally in docx files. Any document transforms that
347
+ get or set the `styleName` property should use the `styleId` property instead.
348
+
349
+ * Allow paragraphs and runs to be matched by style name. For instance, to match
350
+ a paragraph with the style name `Heading 1`:
351
+
352
+ p[style-name='Heading 1']
353
+
354
+ * Use an array of raw strings rather than an array of style mappings when
355
+ passing options to convertToHtml.
356
+
357
+ * Add support for node 0.11 (tested on node 0.11.13).
358
+
359
+ # 0.2.2
360
+
361
+ * Fix: exception when bad arguments are passed into unzip.openZip.
362
+
363
+ # 0.2.1
364
+
365
+ * Fix browserify support.
366
+
367
+ # 0.2.0
368
+
369
+ * Rename mammoth.style() to mammoth.styleMapping().
370
+
371
+ * Add support for document transforms.
372
+
373
+ * Append standard style map to custom style map unless explicitly excluded.